﻿using System;
using System.Collections.Generic;
using System.IO;

namespace Ls.Utils
{
    public static partial class CommonHelper
    {
        /// <summary>
        /// 安全删除文件
        /// </summary>
        /// <param name="path"></param>
        public static void FileSafeDelete(string path) {
            if (File.Exists(path))
            {
                File.Delete(path);
            } 
        }
        /// <summary>
        /// 安全删除目录
        /// </summary>
        /// <param name="path"></param>
        public static void DicSafeDelete(string path)
        {
            if (Directory.Exists(path))
            {
                Directory.Delete(path,true);
            }
        }
    }
}
